<!-- 教学管理-课程安排-运输企业 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="6">
            <el-form-item label="企业类型">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="企业名称">
              <el-input v-model="listQuery.fbillno" placeholder="机构名称" clearable />
            </el-form-item>
          </el-col>

          <template v-if="showAll">

            <el-col :span="6">
            <el-form-item label="联系人">
              <el-input v-model="listQuery.fcustomno" placeholder="企业名称" clearable />
            </el-form-item>
           </el-col>

            <el-col :span="6">
              <el-form-item label="企业状态">
                <el-select v-model="listQuery.fbillstate" placeholder="请选择">
                  <el-option v-for="item in statuslist" :key="item.id" :label="item.fullName" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </template>
          <el-col :span="8">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" >查询</el-button>
              <el-button type="primary" icon="el-icon-plus" @click="insert(undefined)">新增</el-button>
              <el-button type="success" icon="el-icon-download">导出</el-button>
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <!-- <el-table-column prop="FBILLTYPE" label="机构类型" width="85" ></el-table-column> -->
          <el-table-column prop="FBILLNO" label="企业编号" width="115"></el-table-column>
          <el-table-column prop="FBILLNAME" label="企业名称"></el-table-column>
          <el-table-column prop="FTEACH" label="联系人" width="95"></el-table-column>
          <el-table-column prop="FTEL" label="电话号码" width="105"></el-table-column>
          <el-table-column prop="FMEMO" label="地址" ></el-table-column>
          <el-table-column prop="FBILLSTATE" label="企业状态" width="85" ></el-table-column>
          <el-table-column fixed="left" label="操作" align="center" width="100">
            <template slot-scope="scope">
              <el-button type="text" @click="insert(scope.row.FBILLNO)" size="small" icon="el-icon-edit">
                编辑
              </el-button>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"/>
        <Form ref="Form"  :formationlist="customlist" />
      </div>
    </div>
  </div>
</template>
<script>
  import Form from "./Form.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll: false,
        statuslist: [
          {
            id: 1, fullName: '正常'
          },
          {
            id: 2, fullName: '暂停'
          },
          {
            id: 3, fullName: '注销'
          }
        ],

        //所属校区选择数据
        options1: [{
          value: 'L001',
          label: '科创'
        }, {
          value: 'L002',
          label: '爱国'
        }, {
          value: 'L003',
          label: '历史'
        }, {
          value: 'L004',
          label: '户外'
        }],


        customlist:[
          {
            "FTEL":"奉贤海湾校区",
            "FBILLNO": "010908075423.97",
            "FBILLNAME": "综合化学实验1",
            "FTEACH": "秦始皇",
            "FBILLTYPE": "走班课程",
            "FBILLSTATE": "正常",
            "FPOINT":"3",
            "FMEMO": ""
          },
        ],
        list: [
           {
            "FTEL":"021-63358698",
            "FBILLNO": "010908075460",
            "FBILLNAME": "上海美家汽车租赁有限公司",
            "FTEACH": "秦始皇",
            "FBILLTYPE": "民营",
            "FBILLSTATE": "正常",
            "FPOINT":"3",
            "FMEMO": "上海市松江区九亭镇九泾路655号3号楼207"
            },
            {
            "FTEL":"021-36528698",
            "FBILLNO": "010908075465",
            "FBILLNAME": "上海子欣汽车租赁有限公司",
            "FTEACH": "宋太祖",
            "FBILLTYPE": "民营",
            "FBILLSTATE": "正常",
            "FPOINT":"5",
            "FMEMO": "上海市嘉定区翔铁东路1号"
            },{
            "FTEL":"021-68688698",
            "FBILLNO": "034908075465",
            "FBILLNAME": "上海立悦旅游汽车服务有限公司",
            "FTEACH": "汉武帝",
            "FBILLTYPE": "国有",
            "FBILLSTATE": "正常",
            "FPOINT":"3",
            "FMEMO": "上海市浦东新区"
            },
            ,{
            "FTEL":"021-52268698",
            "FBILLNO": "034998565460",
            "FBILLNAME": "上海海博出租汽车有限公司",
            "FTEACH": "唐太宗",
            "FBILLTYPE": "国有",
            "FBILLSTATE": "正常",
            "FPOINT":"5",
            "FMEMO": "光明食品集团旗下的大型国有控股企业"
            },
        ],
        fbillcredate: [jnpf.dateFormat(new Date(), "YYYY-MM-DD"), jnpf.dateFormat(new Date(), "YYYY-MM-DD")],
        loading: false,
        total: 0,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fbillstate: "",
          fbillno: "",
          begindate: undefined,
          enddate: undefined,
          fcustomno: ""
        },
      };
    },
    computed: {},
    methods: {
      insert(id) {
        this.$refs.Form.init(id);
      },
    },
  };
</script>